package lk.icta.core.entity;

import lk.icta.common.entity.BaseEntity;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * @author Kusal Samarakoon
 */
@Entity
@Table(schema = "ELAND_RAIL")
@NamedQueries({
        @NamedQuery(
                name = "getAllAppointmentScheduleByDSDivision",
                query = "SELECT s FROM AppointmentSchedule s WHERE  s.divisionId  = :dsDivisionId"
        ),
        @NamedQuery(name = "getSchedulesByApplicationId",
                query = "SELECT s FROM AppointmentSchedule s WHERE  s.divisionId  = :dsDivisionId AND " +
                        "s.applicationId =:applicationId"),
        @NamedQuery(name = "getSchedulesListByApplicationId",
                query = "SELECT s FROM AppointmentSchedule s WHERE  s.applicationId =:applicationId")
})
public class AppointmentSchedule extends BaseEntity {

    @Column(nullable = false)
    @Temporal(value = TemporalType.DATE)
    private Date appointmentDate;

    @Column(nullable = true)
    private String appointmentTime;

    @Column(nullable = true)
    private String description;

    @Column(nullable = true)
    private String nominee;

    @Column(nullable = true)
    private int attend;

    @Column(nullable = false)
    private long applicationId;

    @Column(nullable = true)
    private int divisionId;

    @Embedded
    private LifeCycleInfo lifeCycleInfo = new LifeCycleInfo();

    public Date getAppointmentDate() {
        return appointmentDate;
    }

    public void setAppointmentDate(Date appointmentDate) {
        this.appointmentDate = appointmentDate;
    }


    public int getAttend() {
        return attend;
    }

    public void setAttend(int attend) {
        this.attend = attend;
    }

    public long getApplicationId() {
        return applicationId;
    }

    public void setApplicationId(long applicationId) {
        this.applicationId = applicationId;
    }

    public LifeCycleInfo getLifeCycleInfo() {
        return lifeCycleInfo;
    }

    public void setLifeCycleInfo(LifeCycleInfo lifeCycleInfo) {
        this.lifeCycleInfo = lifeCycleInfo;
    }

    public String getAppointmentTime() {
        return appointmentTime;
    }

    public void setAppointmentTime(String appointmentTime) {
        this.appointmentTime = appointmentTime;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getNominee() {
        return nominee;
    }

    public void setNominee(String nominee) {
        this.nominee = nominee;
    }

    public int getDivisionId() {
        return divisionId;
    }

    public void setDivisionId(int divisionId) {
        this.divisionId = divisionId;
    }
}
